package com.kaoshi.T19;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/4/7 14:36
 * @description
 */
public class Test {
    public static void main(String[] args) {
        double a = -15.3;
        double b = 8.9;
        int counta = getcount(a);
        int countb = getcount(b);
        System.out.println("绝对值大于10或小于5的整数一共有"+(counta+countb)+"个");
    }

    private static int getcount(double a) {
        int count = 0;
        if (a<0){
            a = a*(-1);
        }
        if (a>10){
            for (int i =(int) a;i>10;i--){
                count++;
            }
        }
        if (a<10&&a>5){
            count = count+5;
        }
        return count;
    }
}
